home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / PInterfaces / CMApplication.p < prev    next >
Encoding:
Text File  |  1995-07-06  |  26.3 KB  |  848 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMApplication.p
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 2.0
  7.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT CMApplication;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __CMAPPLICATION__}
  30. {$SETC __CMAPPLICATION__ := 1}
  31.  
  32. {$I+}
  33. {$SETC CMApplicationIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __QUICKDRAW__}
  43. {$I Quickdraw.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    QuickdrawText.p                                                }
  47.  
  48. {$IFC UNDEFINED __FILES__}
  49. {$I Files.p}
  50. {$ENDC}
  51. {    OSUtils.p                                                    }
  52. {        Memory.p                                                }
  53. {    Finder.p                                                    }
  54.  
  55. {$IFC UNDEFINED __PRINTING__}
  56. {$I Printing.p}
  57. {$ENDC}
  58. {    Errors.p                                                    }
  59. {    Dialogs.p                                                    }
  60. {        Menus.p                                                    }
  61. {        Controls.p                                                }
  62. {        Windows.p                                                }
  63. {            Events.p                                            }
  64. {        TextEdit.p                                                }
  65.  
  66. {$IFC UNDEFINED __CMICCPROFILE__}
  67. {$I CMICCProfile.p}
  68. {$ENDC}
  69.  
  70. {$PUSH}
  71. {$ALIGN MAC68K}
  72. {$LibExport+}
  73.  
  74. CONST
  75.     gestaltColorSync20            = $0200;
  76.  
  77.     kDefaultCMMSignature        = 'appl';
  78.  
  79. { Macintosh 68K trap word }
  80.     cmTrap                        = $ABEE;
  81.  
  82. { PicComment IDs }
  83.     cmBeginProfile                = 220;
  84.     cmEndProfile                = 221;
  85.     cmEnableMatching            = 222;
  86.     cmDisableMatching            = 223;
  87.     cmComment                    = 224;
  88.  
  89. { PicComment selectors for cmComment }
  90.     cmBeginProfileSel            = 0;
  91.     cmContinueProfileSel        = 1;
  92.     cmEndProfileSel                = 2;
  93.  
  94. { Defines for version 1.0 CMProfileSearchRecord.fieldMask }
  95.     cmMatchCMMType                = $00000001;
  96.     cmMatchApplProfileVersion    = $00000002;
  97.     cmMatchDataType                = $00000004;
  98.     cmMatchDeviceType            = $00000008;
  99.     cmMatchDeviceManufacturer    = $00000010;
  100.     cmMatchDeviceModel            = $00000020;
  101.     cmMatchDeviceAttributes        = $00000040;
  102.     cmMatchFlags                = $00000080;
  103.     cmMatchOptions                = $00000100;
  104.     cmMatchWhite                = $00000200;
  105.     cmMatchBlack                = $00000400;
  106.  
  107. { Defines for version 2.0 CMSearchRecord.searchMask }
  108.     cmMatchAnyProfile            = $00000000;
  109.     cmMatchProfileCMMType        = $00000001;
  110.     cmMatchProfileClass            = $00000002;
  111.     cmMatchDataColorSpace        = $00000004;
  112.     cmMatchProfileConnectionSpace = $00000008;
  113.     cmMatchManufacturer            = $00000010;
  114.     cmMatchModel                = $00000020;
  115.     cmMatchAttributes            = $00000040;
  116.     cmMatchProfileFlags            = $00000080;
  117.  
  118. { Result codes }
  119. { General Errors }
  120.     cmProfileError                = -170;
  121.     cmMethodError                = -171;
  122.     cmMethodNotFound            = -175;                            { CMM not present }
  123.     cmProfileNotFound            = -176;                            { Responder error }
  124.     cmProfilesIdentical            = -177;                            { Profiles the same }
  125.     cmCantConcatenateError        = -178;                            { Profile can't be concatenated }
  126.     cmCantXYZ                    = -179;                            { CMM cant handle XYZ space }
  127.     cmCantDeleteProfile            = -180;                            { Responder error }
  128.     cmUnsupportedDataType        = -181;                            { Responder error }
  129.     cmNoCurrentProfile            = -182;                            { Responder error }
  130. { Profile Access Errors }
  131.     cmElementTagNotFound        = -4200;
  132.     cmIndexRangeErr                = -4201;                        { Index out of range }
  133.     cmCantDeleteElement            = -4202;
  134.     cmFatalProfileErr            = -4203;
  135.     cmInvalidProfile            = -4204;                        { A Profile must contain a 'cs1 ' tag to be valid }
  136.     cmInvalidProfileLocation    = -4205;                        { Operation not supported for this profile location }
  137. { Profile Search Errors }
  138.     cmInvalidSearch                = -4206;                        { Bad Search Handle }
  139.     cmSearchError                = -4207;
  140.     cmErrIncompatibleProfile    = -4208;
  141. { Other ColorSync Errors }
  142.     cmInvalidColorSpace            = -4209;                        { Profile colorspace does not match bitmap type }
  143.     cmInvalidSrcMap                = -4210;                        { Source pix/bit map was invalid }
  144.     cmInvalidDstMap                = -4211;                        { Destination pix/bit map was invalid }
  145.     cmNoGDevicesError            = -4212;                        { Begin/End Matching -- no gdevices available }
  146.     cmInvalidProfileComment        = -4213;                        { Bad Profile comment during drawpicture }
  147. { Color Conversion Errors }
  148.     cmRangeOverFlow                = -4214;                        { One or more output color value overflows in color conversion 
  149.                                                         all input color values will still be converted, and the overflown 
  150.                                                         will be clipped }
  151. { Other Profile Access Errors }
  152.     cmCantCopyModifiedV1Profile    = -4215;                        { It is illegal to copy version 1 profiles that  
  153.                                                         have been modified }
  154.  
  155. { deviceType values for ColorSync 1.0 Device Profile access }
  156.     cmSystemDevice                = 'sys ';
  157.     cmGDevice                    = 'gdev';
  158.  
  159. { Commands for CMFlattenUPP(…) }
  160.     cmOpenReadSpool                = 1;
  161.     cmOpenWriteSpool            = 2;
  162.     cmReadSpool                    = 3;
  163.     cmWriteSpool                = 4;
  164.     cmCloseSpool                = 5;
  165.  
  166. { Flags for PostScript-related functions }
  167.     cmPS7bit                    = 1;
  168.     cmPS8bit                    = 2;
  169.  
  170.     
  171. TYPE
  172.     CMProfileRef = Ptr;
  173.  
  174. { Abstract data type for Profile search result }
  175.     CMProfileSearchRef = Ptr;
  176.  
  177. { Abstract data type for BeginMatching(…) reference }
  178.     CMMatchRef = Ptr;
  179.  
  180. { Abstract data type for ColorWorld reference }
  181.     CMWorldRef = Ptr;
  182.  
  183. { Caller-supplied progress function for Bitmap & PixMap matching routines }
  184. { Caller-supplied filter function for Profile search }
  185.     CMFlattenProcPtr = ProcPtr;  { FUNCTION CMFlatten(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr; }
  186.     CMBitmapCallBackProcPtr = ProcPtr;  { FUNCTION CMBitmapCallBack(progress: LONGINT; refCon: UNIV Ptr): BOOLEAN; }
  187.     CMProfileFilterProcPtr = ProcPtr;  { FUNCTION CMProfileFilter(prof: CMProfileRef; refCon: UNIV Ptr): BOOLEAN; }
  188.     CMFlattenUPP = UniversalProcPtr;
  189.     CMBitmapCallBackUPP = UniversalProcPtr;
  190.     CMProfileFilterUPP = UniversalProcPtr;
  191.  
  192. CONST
  193.     uppCMFlattenProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  194.     uppCMBitmapCallBackProcInfo = $000003D0; { FUNCTION (4 byte param, 4 byte param): 1 byte result; }
  195.     uppCMProfileFilterProcInfo = $000003D0; { FUNCTION (4 byte param, 4 byte param): 1 byte result; }
  196.  
  197. FUNCTION NewCMFlattenProc(userRoutine: CMFlattenProcPtr): CMFlattenUPP;
  198.     {$IFC NOT GENERATINGCFM }
  199.     INLINE $2E9F;
  200.     {$ENDC}
  201.  
  202. FUNCTION NewCMBitmapCallBackProc(userRoutine: CMBitmapCallBackProcPtr): CMBitmapCallBackUPP;
  203.     {$IFC NOT GENERATINGCFM }
  204.     INLINE $2E9F;
  205.     {$ENDC}
  206.  
  207. FUNCTION NewCMProfileFilterProc(userRoutine: CMProfileFilterProcPtr): CMProfileFilterUPP;
  208.     {$IFC NOT GENERATINGCFM }
  209.     INLINE $2E9F;
  210.     {$ENDC}
  211.  
  212. FUNCTION CallCMFlattenProc(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMFlattenUPP): OSErr;
  213.     {$IFC NOT GENERATINGCFM}
  214.     INLINE $205F, $4E90;
  215.     {$ENDC}
  216.  
  217. FUNCTION CallCMBitmapCallBackProc(progress: LONGINT; refCon: UNIV Ptr; userRoutine: CMBitmapCallBackUPP): BOOLEAN;
  218.     {$IFC NOT GENERATINGCFM}
  219.     INLINE $205F, $4E90;
  220.     {$ENDC}
  221.  
  222. FUNCTION CallCMProfileFilterProc(prof: CMProfileRef; refCon: UNIV Ptr; userRoutine: CMProfileFilterUPP): BOOLEAN;
  223.     {$IFC NOT GENERATINGCFM}
  224.     INLINE $205F, $4E90;
  225.     {$ENDC}
  226.     
  227. TYPE
  228.     CMError = LONGINT;
  229.  
  230. { For 1.0 and 2.0 profile header variants }
  231. { CMAppleProfileHeader }
  232.     CMAppleProfileHeader = RECORD
  233.         CASE INTEGER OF
  234.         0: (
  235.             cm1:                        CMHeader;
  236.            );
  237.         1: (
  238.             cm2:                        CM2Header;
  239.            );
  240.     END;
  241.  
  242. { Param for CWConcatColorWorld(…) }
  243.     CMConcatProfileSet = RECORD
  244.         keyIndex:                INTEGER;                                { Zero-based }
  245.         count:                    INTEGER;                                { Min 1 }
  246.         profileSet:                ARRAY [0..0] OF CMProfileRef;            { Variable. Ordered from Source -> Dest }
  247.     END;
  248.  
  249. { ColorSync color data types }
  250.     CMRGBColor = RECORD
  251.         red:                    INTEGER;                                { 0..65535 }
  252.         green:                    INTEGER;
  253.         blue:                    INTEGER;
  254.     END;
  255.  
  256.     CMCMYKColor = RECORD
  257.         cyan:                    INTEGER;                                { 0..65535 }
  258.         magenta:                INTEGER;
  259.         yellow:                    INTEGER;
  260.         black:                    INTEGER;
  261.     END;
  262.  
  263.     CMCMYColor = RECORD
  264.         cyan:                    INTEGER;                                { 0..65535 }
  265.         magenta:                INTEGER;
  266.         yellow:                    INTEGER;
  267.     END;
  268.  
  269.     CMHLSColor = RECORD
  270.         hue:                    INTEGER;                                { 0..65535. Fraction of circle. Red at 0 }
  271.         lightness:                INTEGER;                                { 0..65535 }
  272.         saturation:                INTEGER;                                { 0..65535 }
  273.     END;
  274.  
  275.     CMHSVColor = RECORD
  276.         hue:                    INTEGER;                                { 0..65535. Fraction of circle. Red at 0 }
  277.         saturation:                INTEGER;                                { 0..65535 }
  278.         value:                    INTEGER;                                { 0..65535 }
  279.     END;
  280.  
  281.     CMLabColor = RECORD
  282.         L:                        INTEGER;                                { 0..65535 maps to 0..100 }
  283.         a:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  284.         b:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  285.     END;
  286.  
  287.     CMLuvColor = RECORD
  288.         L:                        INTEGER;                                { 0..65535 maps to 0..100 }
  289.         u:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  290.         v:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  291.     END;
  292.  
  293.     CMYxyColor = RECORD
  294.         capY:                    INTEGER;                                { 0..65535 maps to 0..1 }
  295.         x:                        INTEGER;                                { 0..65535 maps to 0..1 }
  296.         y:                        INTEGER;                                { 0..65535 maps to 0..1 }
  297.     END;
  298.  
  299.     CMGrayColor = RECORD
  300.         gray:                    INTEGER;                                { 0..65535 }
  301.     END;
  302.  
  303.     CMMultichannel5Color = RECORD
  304.         components:                ARRAY [0..4] OF SInt8; (* unsigned char *) { 0..255 }
  305.     END;
  306.  
  307.     CMMultichannel6Color = RECORD
  308.         components:                ARRAY [0..5] OF SInt8; (* unsigned char *) { 0..255 }
  309.     END;
  310.  
  311.     CMMultichannel7Color = RECORD
  312.         components:                ARRAY [0..6] OF SInt8; (* unsigned char *) { 0..255 }
  313.     END;
  314.  
  315.     CMMultichannel8Color = RECORD
  316.         components:                ARRAY [0..7] OF SInt8; (* unsigned char *) { 0..255 }
  317.     END;
  318.  
  319.     CMColor = RECORD
  320.         CASE INTEGER OF
  321.         0: (
  322.             rgb:                        CMRGBColor;
  323.            );
  324.         1: (
  325.             hsv:                        CMHSVColor;
  326.            );
  327.         2: (
  328.             hls:                        CMHLSColor;
  329.            );
  330.         3: (
  331.             XYZ:                        CMXYZColor;
  332.            );
  333.         4: (
  334.             Lab:                        CMLabColor;
  335.            );
  336.         5: (
  337.             Luv:                        CMLuvColor;
  338.            );
  339.         6: (
  340.             Yxy:                        CMYxyColor;
  341.            );
  342.         7: (
  343.             cmyk:                        CMCMYKColor;
  344.            );
  345.         8: (
  346.             cmy:                        CMCMYColor;
  347.            );
  348.         9: (
  349.             gray:                        CMGrayColor;
  350.            );
  351.         10: (
  352.             mc5:                        CMMultichannel5Color;
  353.            );
  354.         11: (
  355.             mc6:                        CMMultichannel6Color;
  356.            );
  357.         12: (
  358.             mc7:                        CMMultichannel7Color;
  359.            );
  360.         13: (
  361.             mc8:                        CMMultichannel8Color;
  362.            );
  363.     END;
  364.  
  365.     CMProfileSearchRecord = RECORD
  366.         header:                    CMHeader;
  367.         fieldMask:                LONGINT;
  368.         reserved:                ARRAY [0..1] OF LONGINT;
  369.     END;
  370.  
  371.     CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  372.     CMProfileSearchRecordHandle = ^CMProfileSearchRecordPtr;
  373.  
  374. { Search definition for 2.0 }
  375.     CMSearchRecord = RECORD
  376.         CMMType:                OSType;
  377.         profileClass:            OSType;
  378.         dataColorSpace:            OSType;
  379.         profileConnectionSpace:    OSType;
  380.         deviceManufacturer:        LONGINT;
  381.         deviceModel:            LONGINT;
  382.         deviceAttributes:        ARRAY [0..1] OF LONGINT;
  383.         profileFlags:            LONGINT;
  384.         searchMask:                LONGINT;
  385.         filter:                    CMProfileFilterUPP;
  386.     END;
  387.  
  388. { GetCWInfo structures }
  389.     CMMInfoRecord = RECORD
  390.         CMMType:                OSType;
  391.         CMMVersion:                LONGINT;
  392.     END;
  393.  
  394.     CMCWInfoRecord = RECORD
  395.         cmmCount:                LONGINT;
  396.         cmmInfo:                ARRAY [0..1] OF CMMInfoRecord;
  397.     END;
  398.  
  399.  
  400. CONST
  401.     cmNoColorPacking            = $0000;
  402.     cmAlphaSpace                = $0080;
  403.     cmWord5ColorPacking            = $0500;
  404.     cmLong8ColorPacking            = $0800;
  405.     cmLong10ColorPacking        = $0a00;
  406.     cmAlphaFirstPacking            = $1000;
  407.     cmOneBitDirectPacking        = $0b00;
  408.  
  409.     cmNoSpace                    = 0;
  410.     cmRGBSpace                    = 1;
  411.     cmCMYKSpace                    = 2;
  412.     cmHSVSpace                    = 3;
  413.     cmHLSSpace                    = 4;
  414.     cmYXYSpace                    = 5;
  415.     cmXYZSpace                    = 6;
  416.     cmLUVSpace                    = 7;
  417.     cmLABSpace                    = 8;
  418.     cmReservedSpace1            = 9;
  419.     cmGraySpace                    = 10;
  420.     cmReservedSpace2            = 11;
  421.     cmGamutResultSpace            = 12;
  422.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace;
  423.     cmGrayASpace                = cmGraySpace + cmAlphaSpace;
  424.     cmRGB16Space                = cmWord5ColorPacking + cmRGBSpace;
  425.     cmRGB32Space                = cmLong8ColorPacking + cmRGBSpace;
  426.     cmARGB32Space                = cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace;
  427.     cmCMYK32Space                = cmLong8ColorPacking + cmCMYKSpace;
  428.     cmHSV32Space                = cmLong10ColorPacking + cmHSVSpace;
  429.     cmHLS32Space                = cmLong10ColorPacking + cmHLSSpace;
  430.     cmYXY32Space                = cmLong10ColorPacking + cmYXYSpace;
  431.     cmXYZ32Space                = cmLong10ColorPacking + cmXYZSpace;
  432.     cmLUV32Space                = cmLong10ColorPacking + cmLUVSpace;
  433.     cmLAB32Space                = cmLong10ColorPacking + cmLABSpace;
  434.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace;
  435.  
  436.     
  437. TYPE
  438.     CMBitmapColorSpace = LONGINT;
  439.  
  440.     CMBitmap = RECORD
  441.         image:                    ^CHAR;
  442.         width:                    LONGINT;
  443.         height:                    LONGINT;
  444.         rowBytes:                LONGINT;
  445.         pixelSize:                LONGINT;
  446.         space:                    CMBitmapColorSpace;
  447.         user1:                    LONGINT;
  448.         user2:                    LONGINT;
  449.     END;
  450.  
  451. { Classic Print Manager Stuff }
  452.  
  453. CONST
  454.     enableColorMatchingOp        = 12;
  455.     registerProfileOp            = 13;
  456.  
  457. { PrGeneral parameter blocks }
  458.  
  459. TYPE
  460.     TEnableColorMatchingBlk = RECORD
  461.         iOpCode:                INTEGER;
  462.         iError:                    INTEGER;
  463.         lReserved:                LONGINT;
  464.         hPrint:                    THPrint;
  465.         fEnableIt:                BOOLEAN;
  466.     END;
  467.  
  468.     TRegisterProfileBlk = RECORD
  469.         iOpCode:                INTEGER;
  470.         iError:                    INTEGER;
  471.         lReserved:                LONGINT;
  472.         hPrint:                    THPrint;
  473.         fRegisterIt:            BOOLEAN;
  474.     END;
  475.  
  476.  
  477. CONST
  478.     cmNoProfileBase                = 0;
  479.     cmFileBasedProfile            = 1;
  480.     cmHandleBasedProfile        = 2;
  481.     cmPtrBasedProfile            = 3;
  482.  
  483.  
  484. TYPE
  485.     CMFileLocation = RECORD
  486.         spec:                    FSSpec;
  487.     END;
  488.  
  489.     CMHandleLocation = RECORD
  490.         h:                        Handle;
  491.     END;
  492.  
  493.     CMPtrLocation = RECORD
  494.         p:                        Ptr;
  495.     END;
  496.  
  497.     CMProfLoc = RECORD
  498.         CASE INTEGER OF
  499.         0: (
  500.             fileLoc:                    CMFileLocation;
  501.            );
  502.         1: (
  503.             handleLoc:                    CMHandleLocation;
  504.            );
  505.         2: (
  506.             ptrLoc:                        CMPtrLocation;
  507.            );
  508.     END;
  509.  
  510.     CMProfileLocation = RECORD
  511.         locType:                INTEGER;
  512.         u:                        CMProfLoc;
  513.     END;
  514.  
  515. { Profile file and element access }
  516.  
  517. FUNCTION CMOpenProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  518.     {$IFC NOT GENERATINGCFM}
  519.     INLINE $203C, $0008, $001C, $ABEE;
  520.     {$ENDC}
  521. FUNCTION CMCloseProfile(prof: CMProfileRef): CMError;
  522.     {$IFC NOT GENERATINGCFM}
  523.     INLINE $203C, $0004, $001D, $ABEE;
  524.     {$ENDC}
  525. FUNCTION CMUpdateProfile(prof: CMProfileRef): CMError;
  526.     {$IFC NOT GENERATINGCFM}
  527.     INLINE $203C, $0004, $0034, $ABEE;
  528.     {$ENDC}
  529. FUNCTION CMNewProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  530.     {$IFC NOT GENERATINGCFM}
  531.     INLINE $203C, $0008, $001B, $ABEE;
  532.     {$ENDC}
  533. FUNCTION CMCopyProfile(VAR targetProf: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError;
  534.     {$IFC NOT GENERATINGCFM}
  535.     INLINE $203C, $000C, $0025, $0ABEE;
  536.     {$ENDC}
  537. FUNCTION CMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation): CMError;
  538.     {$IFC NOT GENERATINGCFM}
  539.     INLINE $203C, $0008, $003C, $0ABEE;
  540.     {$ENDC}
  541. FUNCTION CMValidateProfile(prof: CMProfileRef; VAR valid: BOOLEAN; VAR preferredCMMnotfound: BOOLEAN): CMError;
  542.     {$IFC NOT GENERATINGCFM}
  543.     INLINE $203C, $000C, $0026, $0ABEE;
  544.     {$ENDC}
  545. FUNCTION CMFlattenProfile(prof: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  546.     {$IFC NOT GENERATINGCFM}
  547.     INLINE $203C, $0014, $0031, $0ABEE;
  548.     {$ENDC}
  549. FUNCTION CMUnflattenProfile(VAR resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  550.     {$IFC NOT GENERATINGCFM}
  551.     INLINE $203C, $0010, $0032, $0ABEE;
  552.     {$ENDC}
  553. FUNCTION CMProfileElementExists(prof: CMProfileRef; tag: OSType; VAR found: BOOLEAN): CMError;
  554.     {$IFC NOT GENERATINGCFM}
  555.     INLINE $203C, $000C, $001E, $0ABEE;
  556.     {$ENDC}
  557. FUNCTION CMCountProfileElements(prof: CMProfileRef; VAR elementCount: LONGINT): CMError;
  558.     {$IFC NOT GENERATINGCFM}
  559.     INLINE $203C, $0008, $001F, $0ABEE;
  560.     {$ENDC}
  561. FUNCTION CMGetProfileElement(prof: CMProfileRef; tag: OSType; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  562.     {$IFC NOT GENERATINGCFM}
  563.     INLINE $203C, $0010, $0020, $0ABEE;
  564.     {$ENDC}
  565. FUNCTION CMGetProfileHeader(prof: CMProfileRef; VAR header: CMAppleProfileHeader): CMError;
  566.     {$IFC NOT GENERATINGCFM}
  567.     INLINE $203C, $0008, $0039, $0ABEE;
  568.     {$ENDC}
  569. FUNCTION CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; VAR byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  570.     {$IFC NOT GENERATINGCFM}
  571.     INLINE $203C, $0014, $0036, $0ABEE;
  572.     {$ENDC}
  573. FUNCTION CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: LONGINT): CMError;
  574.     {$IFC NOT GENERATINGCFM}
  575.     INLINE $203C, $000C, $0038, $0ABEE;
  576.     {$ENDC}
  577. FUNCTION CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  578.     {$IFC NOT GENERATINGCFM}
  579.     INLINE $203C, $0014, $0037, $0ABEE;
  580.     {$ENDC}
  581. FUNCTION CMGetIndProfileElementInfo(prof: CMProfileRef; index: LONGINT; VAR tag: OSType; VAR elementSize: LONGINT; VAR refs: BOOLEAN): CMError;
  582.     {$IFC NOT GENERATINGCFM}
  583.     INLINE $203C, $0014, $0021, $0ABEE;
  584.     {$ENDC}
  585. FUNCTION CMGetIndProfileElement(prof: CMProfileRef; index: LONGINT; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  586.     {$IFC NOT GENERATINGCFM}
  587.     INLINE $203C, $0010, $0022, $0ABEE;
  588.     {$ENDC}
  589. FUNCTION CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  590.     {$IFC NOT GENERATINGCFM}
  591.     INLINE $203C, $0010, $0023, $0ABEE;
  592.     {$ENDC}
  593. FUNCTION CMSetProfileHeader(prof: CMProfileRef; {CONST}VAR header: CMAppleProfileHeader): CMError;
  594.     {$IFC NOT GENERATINGCFM}
  595.     INLINE $203C, $0008, $003A, $0ABEE;
  596.     {$ENDC}
  597. FUNCTION CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError;
  598.     {$IFC NOT GENERATINGCFM}
  599.     INLINE $203C, $000C, $0035, $0ABEE;
  600.     {$ENDC}
  601. FUNCTION CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError;
  602.     {$IFC NOT GENERATINGCFM}
  603.     INLINE $203C, $0008, $0024, $0ABEE;
  604.     {$ENDC}
  605. FUNCTION CMGetScriptProfileDescription(prof: CMProfileRef; VAR name: Str255; VAR code: ScriptCode): CMError;
  606.     {$IFC NOT GENERATINGCFM}
  607.     INLINE $203C, $000C, $003E, $0ABEE;
  608.     {$ENDC}
  609. { Low-level matching functions }
  610. FUNCTION NCWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError;
  611.     {$IFC NOT GENERATINGCFM}
  612.     INLINE $203C, $000C, $0014, $0ABEE;
  613.     {$ENDC}
  614. FUNCTION CWConcatColorWorld(VAR cw: CMWorldRef; VAR profileSet: CMConcatProfileSet): CMError;
  615.     {$IFC NOT GENERATINGCFM}
  616.     INLINE $203C, $0008, $0015, $0ABEE;
  617.     {$ENDC}
  618. FUNCTION CWNewLinkProfile(VAR prof: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; VAR profileSet: CMConcatProfileSet): CMError;
  619.     {$IFC NOT GENERATINGCFM}
  620.     INLINE $203C, $000C, $0033, $0ABEE;
  621.     {$ENDC}
  622. PROCEDURE CWDisposeColorWorld(cw: CMWorldRef);
  623.     {$IFC NOT GENERATINGCFM}
  624.     INLINE $203C, $0004, $0001, $0ABEE;
  625.     {$ENDC}
  626. FUNCTION CWMatchColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT): CMError;
  627.     {$IFC NOT GENERATINGCFM}
  628.     INLINE $203C, $000C, $0002, $0ABEE;
  629.     {$ENDC}
  630. FUNCTION CWCheckColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT; VAR result: LONGINT): CMError;
  631.     {$IFC NOT GENERATINGCFM}
  632.     INLINE $203C, $0010, $0003, $0ABEE;
  633.     {$ENDC}
  634. { Bitmap matching }
  635. FUNCTION CWMatchBitmap(cw: CMWorldRef; VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR matchedBitmap: CMBitmap): CMError;
  636.     {$IFC NOT GENERATINGCFM}
  637.     INLINE $203C, $0010, $002C, $0ABEE;
  638.     {$ENDC}
  639. FUNCTION CWCheckBitmap(cw: CMWorldRef; {CONST}VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitmap: CMBitmap): CMError;
  640.     {$IFC NOT GENERATINGCFM}
  641.     INLINE $203C, $0014, $002D, $0ABEE;
  642.     {$ENDC}
  643. { Quickdraw-specific matching }
  644. FUNCTION CWMatchPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr): CMError;
  645.     {$IFC NOT GENERATINGCFM}
  646.     INLINE $203C, $0010, $0004, $0ABEE;
  647.     {$ENDC}
  648. FUNCTION CWCheckPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitMap: BitMap): CMError;
  649.     {$IFC NOT GENERATINGCFM}
  650.     INLINE $203C, $0014, $0007, $0ABEE;
  651.     {$ENDC}
  652. FUNCTION NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; VAR myRef: CMMatchRef): CMError;
  653.     {$IFC NOT GENERATINGCFM}
  654.     INLINE $203C, $000C, $0016, $0ABEE;
  655.     {$ENDC}
  656. PROCEDURE CMEndMatching(myRef: CMMatchRef);
  657.     {$IFC NOT GENERATINGCFM}
  658.     INLINE $203C, $0004, $000B, $0ABEE;
  659.     {$ENDC}
  660. PROCEDURE NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; VAR myRect: Rect);
  661.     {$IFC NOT GENERATINGCFM}
  662.     INLINE $203C, $000C, $0017, $0ABEE;
  663.     {$ENDC}
  664. PROCEDURE CMEnableMatchingComment(enableIt: BOOLEAN);
  665.     {$IFC NOT GENERATINGCFM}
  666.     INLINE $203C, $0002, $000D, $0ABEE;
  667.     {$ENDC}
  668. FUNCTION NCMUseProfileComment(prof: CMProfileRef; flags: LONGINT): CMError;
  669.     {$IFC NOT GENERATINGCFM}
  670.     INLINE $203C, $0008, $003B, $0ABEE;
  671.     {$ENDC}
  672. { System Profile access }
  673. FUNCTION CMGetSystemProfile(VAR prof: CMProfileRef): CMError;
  674.     {$IFC NOT GENERATINGCFM}
  675.     INLINE $203C, $0004, $0018, $0ABEE;
  676.     {$ENDC}
  677. FUNCTION CMSetSystemProfile({CONST}VAR profileFileSpec: FSSpec): CMError;
  678.     {$IFC NOT GENERATINGCFM}
  679.     INLINE $203C, $0004, $0019, $0ABEE;
  680.     {$ENDC}
  681. { External Profile Management }
  682. FUNCTION CMNewProfileSearch(VAR searchSpec: CMSearchRecord; refCon: UNIV Ptr; VAR count: LONGINT; VAR searchResult: CMProfileSearchRef): CMError;
  683.     {$IFC NOT GENERATINGCFM}
  684.     INLINE $203C, $0010, $0027, $0ABEE;
  685.     {$ENDC}
  686. FUNCTION CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UNIV Ptr; VAR count: LONGINT): CMError;
  687.     {$IFC NOT GENERATINGCFM}
  688.     INLINE $203C, $000C, $0028, $0ABEE;
  689.     {$ENDC}
  690. PROCEDURE CMDisposeProfileSearch(search: CMProfileSearchRef);
  691.     {$IFC NOT GENERATINGCFM}
  692.     INLINE $203C, $0004, $0029, $0ABEE;
  693.     {$ENDC}
  694. FUNCTION CMSearchGetIndProfile(search: CMProfileSearchRef; index: LONGINT; VAR prof: CMProfileRef): CMError;
  695.     {$IFC NOT GENERATINGCFM}
  696.     INLINE $203C, $000C, $002A, $0ABEE;
  697.     {$ENDC}
  698. FUNCTION CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: LONGINT; VAR profileFile: FSSpec): CMError;
  699.     {$IFC NOT GENERATINGCFM}
  700.     INLINE $203C, $000C, $002B, $0ABEE;
  701.     {$ENDC}
  702. { Utilities }
  703. FUNCTION CMGetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  704.     {$IFC NOT GENERATINGCFM}
  705.     INLINE $203C, $000C, $0011, $0ABEE;
  706.     {$ENDC}
  707. FUNCTION CMGetCWInfo(cw: CMWorldRef; VAR info: CMCWInfoRecord): CMError;
  708.     {$IFC NOT GENERATINGCFM}
  709.     INLINE $203C, $000C, $001A, $0ABEE;
  710.     {$ENDC}
  711. { PS-related }
  712. FUNCTION CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  713.     {$IFC NOT GENERATINGCFM}
  714.     INLINE $203C, $0014, $002E, $0ABEE;
  715.     {$ENDC}
  716. FUNCTION CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  717.     {$IFC NOT GENERATINGCFM}
  718.     INLINE $203C, $0014, $002F, $0ABEE;
  719.     {$ENDC}
  720. FUNCTION CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  721.     {$IFC NOT GENERATINGCFM}
  722.     INLINE $203C, $0018, $0030, $0ABEE;
  723.     {$ENDC}
  724. FUNCTION CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; VAR vmSize: LONGINT; VAR preferredCMMnotfound: BOOLEAN): CMError;
  725.     {$IFC NOT GENERATINGCFM}
  726.     INLINE $203C, $0010, $003D, $0ABEE;
  727.     {$ENDC}
  728. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  729. FUNCTION CWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError;
  730.     {$IFC NOT GENERATINGCFM}
  731.     INLINE $203C, $000C, $0000, $0ABEE;
  732.     {$ENDC}
  733. FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; VAR newDst: CMProfileHandle): CMError;
  734.     {$IFC NOT GENERATINGCFM}
  735.     INLINE $203C, $000C, $000C, $0ABEE;
  736.     {$ENDC}
  737. FUNCTION CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  738.     {$IFC NOT GENERATINGCFM}
  739.     INLINE $203C, $000C, $000A, $0ABEE;
  740.     {$ENDC}
  741. PROCEDURE CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  742.     {$IFC NOT GENERATINGCFM}
  743.     INLINE $203C, $000C, $0009, $0ABEE;
  744.     {$ENDC}
  745. FUNCTION CMUseProfileComment(profile: CMProfileHandle): CMError;
  746.     {$IFC NOT GENERATINGCFM}
  747.     INLINE $203C, $0004, $0008, $0ABEE;
  748.     {$ENDC}
  749. PROCEDURE CMGetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  750.     {$IFC NOT GENERATINGCFM}
  751.     INLINE $203C, $0008, $000E, $0ABEE;
  752.     {$ENDC}
  753. FUNCTION CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  754.     {$IFC NOT GENERATINGCFM}
  755.     INLINE $203C, $0004, $000F, $0ABEE;
  756.     {$ENDC}
  757. { ProfileResponder functions }
  758. FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle; VAR returnedProfile: CMProfileHandle): CMError;
  759.     {$IFC NOT GENERATINGCFM}
  760.     INLINE $203C, $0010, $0005, $0ABEE;
  761.     {$ENDC}
  762. FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
  763.     {$IFC NOT GENERATINGCFM}
  764.     INLINE $203C, $000C, $0006, $0ABEE;
  765.     {$ENDC}
  766. FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: LONGINT; hProfile: CMProfileHandle): CMError;
  767.     {$IFC NOT GENERATINGCFM}
  768.     INLINE $203C, $0010, $0010, $0ABEE;
  769.     {$ENDC}
  770. FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle; VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
  771.     {$IFC NOT GENERATINGCFM}
  772.     INLINE $203C, $0014, $0012, $0ABEE;
  773.     {$ENDC}
  774. FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
  775.     {$IFC NOT GENERATINGCFM}
  776.     INLINE $203C, $000C, $0013, $0ABEE;
  777.     {$ENDC}
  778. {$IFC OLDROUTINENAMES }
  779.  
  780. CONST
  781.     kMatchCMMType                = cmMatchCMMType;
  782.     kMatchApplProfileVersion    = cmMatchApplProfileVersion;
  783.     kMatchDataType                = cmMatchDataType;
  784.     kMatchDeviceType            = cmMatchDeviceType;
  785.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer;
  786.     kMatchDeviceModel            = cmMatchDeviceModel;
  787.     kMatchDeviceAttributes        = cmMatchDeviceAttributes;
  788.     kMatchFlags                    = cmMatchFlags;
  789.     kMatchOptions                = cmMatchOptions;
  790.     kMatchWhite                    = cmMatchWhite;
  791.     kMatchBlack                    = cmMatchBlack;
  792.  
  793. { types }
  794.     
  795. TYPE
  796.     CMYKColor = CMCMYKColor;
  797.  
  798.     CWorld = CMWorldRef;
  799.  
  800.     CMGamutResult = ^LONGINT;
  801.  
  802. { functions }
  803.  
  804. PROCEDURE EndMatching(myRef: CMMatchRef);
  805.     {$IFC NOT GENERATINGCFM}
  806.     INLINE $203C, $0004, $000B, $0ABEE;
  807.     {$ENDC}
  808. PROCEDURE EnableMatching(enableIt: BOOLEAN);
  809.     {$IFC NOT GENERATINGCFM}
  810.     INLINE $203C, $0002, $000D, $0ABEE;
  811.     {$ENDC}
  812. FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  813.     {$IFC NOT GENERATINGCFM}
  814.     INLINE $203C, $000C, $0011, $0ABEE;
  815.     {$ENDC}
  816. FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  817.     {$IFC NOT GENERATINGCFM}
  818.     INLINE $203C, $000C, $000A, $0ABEE;
  819.     {$ENDC}
  820. PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  821.     {$IFC NOT GENERATINGCFM}
  822.     INLINE $203C, $000C, $0009, $0ABEE;
  823.     {$ENDC}
  824. FUNCTION UseProfile(profile: CMProfileHandle): CMError;
  825.     {$IFC NOT GENERATINGCFM}
  826.     INLINE $203C, $0004, $0008, $0ABEE;
  827.     {$ENDC}
  828. PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  829.     {$IFC NOT GENERATINGCFM}
  830.     INLINE $203C, $0008, $000E, $0ABEE;
  831.     {$ENDC}
  832. FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  833.     {$IFC NOT GENERATINGCFM}
  834.     INLINE $203C, $0004, $000F, $0ABEE;
  835.     {$ENDC}
  836. {$ENDC}
  837.  
  838. {$ALIGN RESET}
  839. {$POP}
  840.  
  841. {$SETC UsingIncludes := CMApplicationIncludes}
  842.  
  843. {$ENDC} {__CMAPPLICATION__}
  844.  
  845. {$IFC NOT UsingIncludes}
  846.  END.
  847. {$ENDC}
  848.